package com.example.boot.controller;

import com.example.boot.bean.Account;
import com.example.boot.bean.City;
import com.example.boot.service.AccountService;
import com.example.boot.service.CityService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author shkstart
 * @creat 2021-04-07-上午10:13
 */
@Controller
public class AccountController {
//    @Autowired
    AccountService accountService;
    @Autowired
    CityService cityService;
    @GetMapping("/acct")
    @ResponseBody
    public Account getById(@RequestParam("id") Long id){
        Account accByid = accountService.getAccByid(id);
        return accByid;
    }
    @GetMapping("/city")
    @ResponseBody
    public City getCityById(@RequestParam("id") Long id){
        return cityService.getCity(id);
    }
}
